﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:Sora_HelpSystem_UI_WPF="clr-namespace:Sora.HelpSystem.UI.WPF;assembly=Sora.HelpSystem.UI.WPF" x:Class="Sora.HelpSystem.Viewer.MainWindow"
        Title="MainWindow" Height="400" Width="600" Name="mainWindow" xmlns:my="clr-namespace:Sora.HelpSystem.Viewer.Converters" Icon="/HelpView;component/Images/help-18.png">
	<Window.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Sora.HelpSystem.UI.WPF;component/UICommonStyles.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
				<GradientStop Color="#ABADB3" Offset="0.05"/>
				<GradientStop Color="#E2E3EA" Offset="0.07"/>
				<GradientStop Color="#E3E9EF" Offset="1"/>
			</LinearGradientBrush>
			<my:StringToUriConverter x:Key="StringToUriConverter" />
			<Style x:Key="ButtonFocusVisual">
				<Setter Property="Control.Template">
					<Setter.Value>
						<ControlTemplate>
							<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2"/>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
			<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
				<GradientStop Color="#F3F3F3" Offset="0"/>
				<GradientStop Color="#EBEBEB" Offset="0.5"/>
				<GradientStop Color="#DDDDDD" Offset="0.5"/>
				<GradientStop Color="#CDCDCD" Offset="1"/>
			</LinearGradientBrush>
			<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
			<Style x:Key="CommandBtnStyle" TargetType="{x:Type Button}">
				<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
				<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
				<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
				<Setter Property="BorderThickness" Value="1"/>
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
				<Setter Property="HorizontalContentAlignment" Value="Center"/>
				<Setter Property="VerticalContentAlignment" Value="Center"/>
				<Setter Property="Padding" Value="1"/>
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type Button}">
							<Border x:Name="border" BorderThickness="1" CornerRadius="2" BorderBrush="#00000000">
								<Border.Background>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#00646464"/>
										<GradientStop Color="#00C6C6C6" Offset="1"/>
									</LinearGradientBrush>
								</Border.Background>
								<ContentPresenter RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
							</Border>
							<ControlTemplate.Triggers>
								<Trigger Property="IsMouseOver" Value="True">
									<Setter Property="BorderBrush" TargetName="border" Value="#33000000"/>
									<Setter Property="Background" TargetName="border">
										<Setter.Value>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#00646464"/>
												<GradientStop Color="#FFC6C6C6" Offset="1"/>
											</LinearGradientBrush>
										</Setter.Value>
									</Setter>
								</Trigger>
								<Trigger Property="IsPressed" Value="True">
									<Setter Property="Background" TargetName="border">
										<Setter.Value>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#00646464" Offset="1"/>
												<GradientStop Color="#FFC6C6C6" Offset="0"/>
											</LinearGradientBrush>
										</Setter.Value>
									</Setter>
									<Setter Property="BorderBrush" TargetName="border" Value="#33000000"/>
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
		</ResourceDictionary>
    </Window.Resources>
    <Grid>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="30"/>
    		<RowDefinition Height="*"/>
    	</Grid.RowDefinitions>
        
        <Rectangle>
        	<Rectangle.Fill>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="White"/>
        			<GradientStop Color="White" Offset="1"/>
        			<GradientStop Color="#FF9B9B9B" Offset="0.982"/>
        			<GradientStop Color="#FFE8E8E8" Offset="0.91"/>
        			<GradientStop Color="#FFE4E4E4" Offset="0.834"/>
        		</LinearGradientBrush>
        	</Rectangle.Fill>
        </Rectangle>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30" />
                <ColumnDefinition Width="30" />
                <ColumnDefinition Width="30" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="30" />
                <ColumnDefinition Width="30" />
            </Grid.ColumnDefinitions>
            
            <Button Grid.Column="0" x:Name="goPrev" Click="goPrev_Click" Margin="2,2,2,4" Style="{DynamicResource CommandBtnStyle}">
                <Image Source="/HelpView;component/Images/control_rewind.png" Stretch="None"/>
            </Button>
            <Button Grid.Column="1" x:Name="goNext" Click="goNext_Click" Margin="2,2,2,4" Style="{DynamicResource CommandBtnStyle}">
                <Image Source="/HelpView;component/Images/control_fastforward.png" Stretch="None"/>
            </Button>
            <Button Grid.Column="2" x:Name="goHome" Click="goHome_Click" Margin="2,2,2,4" Style="{DynamicResource CommandBtnStyle}">
                <Image Source="/HelpView;component/Images/house.png" Stretch="None"/>
            </Button>

            <Button Grid.Column="4" x:Name="goExecute" Click="goExecute_Click"  Margin="2,2,2,4" Style="{DynamicResource CommandBtnStyle}">
                <Image Source="/HelpView;component/Images/control_play_blue.png" Stretch="None" />
            </Button>
            <Button Grid.Column="5" x:Name="goCancel" Click="goCancel_Click" Margin="2,2,2,4" Style="{DynamicResource CommandBtnStyle}">
                <Image Source="/HelpView;component/Images/stop.png" Stretch="None" />
            </Button>

            <Border Grid.Column="3" Margin="5" BorderBrush="LightGray" CornerRadius="2" Background="White" BorderThickness="1">
                <TextBox Text="..." BorderBrush="{x:Null}" Margin="2,0,2,0" BorderThickness="0" IsReadOnly="False" Name="uriTextBox" KeyDown="uriTextBox_KeyDown" />
            </Border>
        </Grid>

        <Grid Grid.Row="1">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="200" />
				<ColumnDefinition Width="5" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
        
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="67" />
					<RowDefinition Height="*" />
				</Grid.RowDefinitions>

				<Rectangle Height="1" Fill="LightGray" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="1"/>
            
				<StackPanel Margin="5">
					<TextBlock><Run Text="Search"/></TextBlock>
                    <Grid Margin="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="5" />
                            <ColumnDefinition Width="25" />
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="2" x:Name="goSearch" Click="goSearch_Click" Margin="2" Style="{DynamicResource CommandBtnStyle}">
                            <Image Source="/HelpView;component/Images/magnifier.png" Stretch="None" />
                        </Button>
                        <Border BorderBrush="LightGray" CornerRadius="2" Background="White" BorderThickness="1">
                            <TextBox Name="searchBox" BorderBrush="{x:Null}" Margin="2" BorderThickness="0" KeyDown="searchBox_KeyDown"/>
                        </Border>
                    </Grid>
                </StackPanel>
                
                <Sora_HelpSystem_UI_WPF:HelpContentSummary x:Name="helpSummary" Grid.Row="1" Document="{Binding ElementName=mainWindow, Path=Document}" Margin="0,1,0,0"/>
			</Grid>
        
			<GridSplitter Grid.Column="1" Background="White" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>

			<Rectangle Width="1" Grid.Column="2" Fill="LightGray" VerticalAlignment="Stretch" HorizontalAlignment="Left"/>
        
			<Grid Grid.Column="2" Margin="1,0,0,0">
				<Grid.RowDefinitions>
					<RowDefinition Height="70" />
					<RowDefinition Height="*" />
				</Grid.RowDefinitions>

                <Border Margin="2" BorderThickness="0,0,0,1" BorderBrush="#FFB6B6B6">
            
					<Sora_HelpSystem_UI_WPF:HelpContentDisplay x:Name="helpHeader" Document="{Binding Document, ElementName=mainWindow}"/>

				</Border>

                <Sora_HelpSystem_UI_WPF:HelpContentDisplay Grid.Row="1" x:Name="helpContent" CurrentPageUri="{Binding CurrentDocumentUri, ElementName=mainWindow}" Document="{Binding Document, ElementName=mainWindow}" />
			</Grid>
		</Grid>
	</Grid>
</Window>
